<template>
    <div>
        <el-card class="!border-none" shadow="never">
            <el-page-header :content="$route.meta.title" @back="$router.back()" />
        </el-card>
        <el-card class="mt-4 !border-none" v-loading="loading" shadow="never">
            <div class="mt-4">
                <el-table :data="listData">
                    <el-table-column label="操作人" prop="admin_name" show-overflow-tooltip align="center"/>
                    <el-table-column label="操作数量" prop="number" show-overflow-tooltip align="center"/>
                    <el-table-column label="操作类型" prop="type_name" show-overflow-tooltip align="center"/>
                    <el-table-column label="备注" prop="remark" show-overflow-tooltip align="center"/>
                    <el-table-column label="操作时间" prop="create_time" show-overflow-tooltip align="center"/>
                </el-table>
            </div>
        </el-card>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { goodsStock_log } from '@/api/goods'
import { useRoute } from 'vue-router'
const route = useRoute()
// import { defineProps, defineEmits, computed } from 'vue';

// const props = defineProps({
//   foo: String
// });

// const emit = defineEmits(['change', 'delete']);

const message = ref('Hello Vue 3!');
const loading = ref(false)
const listData = ref<any[]>([])

const getListData = async () => {
    loading.value = true
    const lists  = await goodsStock_log({ sku_id: route.query.id })
    console.log(lists)
    listData.value = lists
    loading.value = false
}

onMounted(() => {
    getListData()
})
</script>

<style scoped></style>